Skip to content

ELFCore: Parse core notes without pyelftools - #889

Merged
ltfish merged 1 commit into
masterfrom
fix/elfcore-pyelftools-notes
Nov 12, 2026
Merged

ltfish merged 1 commit into
masterfrom
fix/elfcore-pyelftools-notes

Conversation

@ltfish

@ltfish ltfish commented Nov 12, 2026

Copy link
Copy Markdown
Member

A recent commit in pyelftools (eliben/pyelftools@5466000) causes cle to fail to load notes in FreeBSD core files. We are now parsing core notes without pyelftools.

pyelftools 5466000 ("Notes fixes", unreleased) names note types only for
the owners whose namespace it knows, so FreeBSD notes now arrive with
numeric types and the "NT_PRSTATUS" comparison never matches; every
FreeBSD core loaded without threads. It also decodes each descriptor from
its own bytes alone, and its x32 NT_PRPSINFO struct, with 32-bit uid and
gid, is four bytes longer than the note, so loading an x32 core raised
ELFParseError.

Iterate PT_NOTE segments in ELFCore, keep note types as numbers, and parse
NT_PRPSINFO and NT_FILE from the raw descriptor. pr_fname is read from the
end of NT_PRPSINFO, which is where it sits on every ABI, which also fixes
x32 cores reporting pr_fname "t" under every released pyelftools.
@ltfish ltfish self-assigned this Nov 12, 2026
@ltfish

ltfish commented Nov 12, 2026

Copy link
Copy Markdown
Member Author

Related (but not deprecating this PR): eliben/pyelftools#700

@ltfish ltfish changed the title ELFCore: Walk core notes without pyelftools ELFCore: Parse core notes without pyelftools Nov 12, 2026
@angr-bot

Copy link
Copy Markdown
Member

Corpus decompilation diffs can be found at angr/dec-snapshots@master...angr/cle_889

@ltfish
ltfish merged commit dceeec8 into master Nov 12, 2026
20 checks passed
@ltfish
ltfish deleted the fix/elfcore-pyelftools-notes branch November 12, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants